/*
 * This class was automatically generated with 
 * <a href="http://www.castor.org">Castor 1.0.4</a>, using an XML
 * Schema.
 * $Id$
 */

package com.jzhao.jpre.format.sequential.castor;

  //---------------------------------/
 //- Imported classes and packages -/
//---------------------------------/

import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;

/**
 * Class TransitionsType.
 * 
 * @version $Revision$ $Date$
 */
public class TransitionsType implements java.io.Serializable {


      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * Field _refField
     */
    private java.lang.String _refField;

    /**
     * Field _transitionList
     */
    private java.util.Vector _transitionList;


      //----------------/
     //- Constructors -/
    //----------------/

    public TransitionsType() 
     {
        super();
        this._transitionList = new java.util.Vector();
    } //-- com.jzhao.jpre.format.sequential.castor.TransitionsType()


      //-----------/
     //- Methods -/
    //-----------/

    /**
     * 
     * 
     * @param vTransition
     * @throws java.lang.IndexOutOfBoundsException if the index
     * given is outside the bounds of the collection
     */
    public void addTransition(com.jzhao.jpre.format.sequential.castor.Transition vTransition)
        throws java.lang.IndexOutOfBoundsException
    {
        this._transitionList.addElement(vTransition);
    } //-- void addTransition(com.jzhao.jpre.format.sequential.castor.Transition) 

    /**
     * 
     * 
     * @param index
     * @param vTransition
     * @throws java.lang.IndexOutOfBoundsException if the index
     * given is outside the bounds of the collection
     */
    public void addTransition(int index, com.jzhao.jpre.format.sequential.castor.Transition vTransition)
        throws java.lang.IndexOutOfBoundsException
    {
        this._transitionList.add(index, vTransition);
    } //-- void addTransition(int, com.jzhao.jpre.format.sequential.castor.Transition) 

    /**
     * Method enumerateTransition
     * 
     * 
     * 
     * @return an Enumeration over all
     * com.jzhao.jpre.format.sequential.castor.Transition elements
     */
    public java.util.Enumeration enumerateTransition()
    {
        return this._transitionList.elements();
    } //-- java.util.Enumeration enumerateTransition() 

    /**
     * Returns the value of field 'refField'.
     * 
     * @return the value of field 'RefField'.
     */
    public java.lang.String getRefField()
    {
        return this._refField;
    } //-- java.lang.String getRefField() 

    /**
     * Method getTransition
     * 
     * 
     * 
     * @param index
     * @throws java.lang.IndexOutOfBoundsException if the index
     * given is outside the bounds of the collection
     * @return the value of the
     * com.jzhao.jpre.format.sequential.castor.Transition at the
     * given index
     */
    public com.jzhao.jpre.format.sequential.castor.Transition getTransition(int index)
        throws java.lang.IndexOutOfBoundsException
    {
        // check bounds for index
        if (index < 0 || index >= this._transitionList.size()) {
            throw new IndexOutOfBoundsException("getTransition: Index value '" + index + "' not in range [0.." + (this._transitionList.size() - 1) + "]");
        }
        
        return (com.jzhao.jpre.format.sequential.castor.Transition) _transitionList.get(index);
    } //-- com.jzhao.jpre.format.sequential.castor.Transition getTransition(int) 

    /**
     * Method getTransition
     * 
     * 
     * 
     * @return this collection as an Array
     */
    public com.jzhao.jpre.format.sequential.castor.Transition[] getTransition()
    {
        int size = this._transitionList.size();
        com.jzhao.jpre.format.sequential.castor.Transition[] array = new com.jzhao.jpre.format.sequential.castor.Transition[size];
        for (int index = 0; index < size; index++){
            array[index] = (com.jzhao.jpre.format.sequential.castor.Transition) _transitionList.get(index);
        }
        
        return array;
    } //-- com.jzhao.jpre.format.sequential.castor.Transition[] getTransition() 

    /**
     * Method getTransitionCount
     * 
     * 
     * 
     * @return the size of this collection
     */
    public int getTransitionCount()
    {
        return this._transitionList.size();
    } //-- int getTransitionCount() 

    /**
     * Method isValid
     * 
     * 
     * 
     * @return true if this object is valid according to the schema
     */
    public boolean isValid()
    {
        try {
            validate();
        }
        catch (org.exolab.castor.xml.ValidationException vex) {
            return false;
        }
        return true;
    } //-- boolean isValid() 

    /**
     * 
     * 
     * @param out
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     */
    public void marshal(java.io.Writer out)
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, out);
    } //-- void marshal(java.io.Writer) 

    /**
     * 
     * 
     * @param handler
     * @throws java.io.IOException if an IOException occurs during
     * marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     */
    public void marshal(org.xml.sax.ContentHandler handler)
        throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, handler);
    } //-- void marshal(org.xml.sax.ContentHandler) 

    /**
     */
    public void removeAllTransition()
    {
        this._transitionList.clear();
    } //-- void removeAllTransition() 

    /**
     * Method removeTransition
     * 
     * 
     * 
     * @param vTransition
     * @return true if the object was removed from the collection.
     */
    public boolean removeTransition(com.jzhao.jpre.format.sequential.castor.Transition vTransition)
    {
        boolean removed = _transitionList.remove(vTransition);
        return removed;
    } //-- boolean removeTransition(com.jzhao.jpre.format.sequential.castor.Transition) 

    /**
     * Method removeTransitionAt
     * 
     * 
     * 
     * @param index
     * @return the element removed from the collection
     */
    public com.jzhao.jpre.format.sequential.castor.Transition removeTransitionAt(int index)
    {
        Object obj = this._transitionList.remove(index);
        return (com.jzhao.jpre.format.sequential.castor.Transition) obj;
    } //-- com.jzhao.jpre.format.sequential.castor.Transition removeTransitionAt(int) 

    /**
     * Sets the value of field 'refField'.
     * 
     * @param refField the value of field 'refField'.
     */
    public void setRefField(java.lang.String refField)
    {
        this._refField = refField;
    } //-- void setRefField(java.lang.String) 

    /**
     * 
     * 
     * @param index
     * @param vTransition
     * @throws java.lang.IndexOutOfBoundsException if the index
     * given is outside the bounds of the collection
     */
    public void setTransition(int index, com.jzhao.jpre.format.sequential.castor.Transition vTransition)
        throws java.lang.IndexOutOfBoundsException
    {
        // check bounds for index
        if (index < 0 || index >= this._transitionList.size()) {
            throw new IndexOutOfBoundsException("setTransition: Index value '" + index + "' not in range [0.." + (this._transitionList.size() - 1) + "]");
        }
        
        this._transitionList.set(index, vTransition);
    } //-- void setTransition(int, com.jzhao.jpre.format.sequential.castor.Transition) 

    /**
     * 
     * 
     * @param vTransitionArray
     */
    public void setTransition(com.jzhao.jpre.format.sequential.castor.Transition[] vTransitionArray)
    {
        //-- copy array
        _transitionList.clear();
        
        for (int i = 0; i < vTransitionArray.length; i++) {
                this._transitionList.add(vTransitionArray[i]);
        }
    } //-- void setTransition(com.jzhao.jpre.format.sequential.castor.Transition) 

    /**
     * Method unmarshal
     * 
     * 
     * 
     * @param reader
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     * @return the unmarshaled
     * com.jzhao.jpre.format.sequential.castor.TransitionsType
     */
    public static com.jzhao.jpre.format.sequential.castor.TransitionsType unmarshal(java.io.Reader reader)
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        return (com.jzhao.jpre.format.sequential.castor.TransitionsType) Unmarshaller.unmarshal(com.jzhao.jpre.format.sequential.castor.TransitionsType.class, reader);
    } //-- com.jzhao.jpre.format.sequential.castor.TransitionsType unmarshal(java.io.Reader) 

    /**
     * 
     * 
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     */
    public void validate()
        throws org.exolab.castor.xml.ValidationException
    {
        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
        validator.validate(this);
    } //-- void validate() 

}
